package player.mplayer;

import java.io.Serializable;

import player.Tools;


public class MediaInfo implements Serializable{
	private static final long serialVersionUID = 767230943711110112L;
	public long fileSize=0;
	public String fileType;
	String lengthStr;
	public boolean isMedia=false;
	public String mediaPath;
	public String subTitle=null;
	public int lastPlayOffset=0;
	
	public int videoWidth=0;
	public int videoHeight=0;

	public String decoder="";
	
	public String fileName;
	public String fileDir;
	public String filePath;
	public int length;
	 public String format="";
	 public long size;
	 public int width=100;
	 public int height=100;
	 public int fps=0;
	
	 public boolean isPlaying=false;
	String text="";
	public MediaInfo() {
		
	}


	public String toString(){
		String s="";
		s=videoWidth+" "+videoHeight+" "+fps+" "+decoder+" "+length+" "+format;
		return s;
	}
	
	
	public String getText(){
		text="";
		addStart();
		addLine("File Name",fileName);
		addLine("Size",Tools.getSizeString(fileSize));
		addLine("Length",Tools.getTimeString(length));
		addLine("Resolution",videoWidth+"x"+videoHeight);
		addLine("Format",format);
		addLine("Frame rate",fps+"");
		addLine("Splitter",decoder);
		//addLine("");
		addComplete();
		return text;
	}
	
	 void addStart(){
		text="<html><body>";
		text+="<table border=\"0\">";
	}
	
	 void addLine(String s1){
			text+="<tr><td>"+s1+"</td>"+"</tr>";
		}
	 
	 void addLine(String s1,String s2){
		text+="<tr> <td>"+s1+"</td width:14px >"+"<td>"+s2+"</td></tr>";
	}
	
	 void addComplete(){
		text+="</table>";
		text+="<body></html>";
	}
	
}
